<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <link rel="icon" type="image/x-icon" href="img/head/favicon.ico" />
    <link href="css/orderList.css" rel="stylesheet" type="text/css">
    <link href="css/cart.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/foot.css"/>
    <link rel="stylesheet" href="css/head.css"/>
    <noscript>抱歉，你的浏览器不支持 JavaScript!</noscript>
    <script type="text/javascript" src="js/base-v1.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/jquery-1.2.6.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/cookie.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/common.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/jquery.cookie.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/jquery.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/jquery-extend.js"></script>
    <script type="text/javascript" src="js/logout.js"></script>
    <script type="text/javascript" src="js/lib-v1.js" charset="utf-8"></script>
    <meta charset="UTF-8">
</head>
<body onload="query()">

<div id="orders" style="text-align: center;"></div>

</body>
<script>

    function query(){
        var oid=sessionStorage.getItem("oid")
      $.ajax({
        url:"queryOrderItme",
        dataType:"json",
        data:{"oid":oid},
        type:"GET",
        success:function (data) {
            $("#orders").append("<div class='warp'><h3 style='text-align: center;' class='title'>订单信息</h3></div>");

            $("#orders").append(
                "<table id='orderTable_' class='title'>" +
                "<tr >" +
                "<th >商品图片</th>" +
                "<th >商品名称</th>" +
                "<th >商品单价</th>" +
                "<th >购买数量</th>" +
                "<th >小计</th>" +
                "</tr>" +
                "</table>"
            );
            if(data.length>=0){
                $.each(data,function (indexnumber,orderItem) {
                    let money = orderItem.num * orderItem.product_price;
                    $("#orderTable_").append(
                        "<tr class='prods'>" +
                        "<td ><img src='"+orderItem.product_image+"' width='80' height='90' alt='商品图片'></td>" +
                        "<td >"+orderItem.product_name+"</td>" +
                        "<td >"+orderItem.product_price+"元</td>" +
                        "<td >"+orderItem.num+"件</td>" +
                        "<td >"+money+"元</td>" +
                        "</tr>"
                    );
                });
            }
        },
        error:function () {

        }
    })
    }
</script>
</html>